<template>
	<view class="wrap">
		<js-error mode="bottom" ref="jsError"></js-error>		
		<view>
			<u-form class="form" :model="model" :rules="rules" ref="uForm" label-position="left" style="padding: 0 10px">
				<scroll-view
				  scroll-y="true"
				  :style="{ height: scrollViewHeight + 'px' }"
				  class="scroll-view-class"
				>
					<view class="bg-white padding shadow radius margin-bottom">
						<view class="flex">
							<u-icon  class="cuIcon-titles" size="50" color="#0081ff"></u-icon> 
							<view class="text-xxl text-black">产品信息</view>
						</view>
						<u-form-item label="产品名称" prop="chanpin_name" label-width="180">
							冲孔落料模
						</u-form-item>
						<u-form-item label="工序名称" prop="gongxu_name" label-width="180">
							冲孔落料
						</u-form-item>
						<u-form-item label="加工数量" prop="jiagong_number" label-width="180">
							100次
						</u-form-item>
					</view>
					<view class="bg-white padding shadow radius margin-bottom">
						<view class="flex">
							<u-icon  class="cuIcon-titles" size="50" color="#0081ff"></u-icon> 
							<view class="text-xxl text-black">设备信息</view>
						</view>
						<u-form-item label="设备名称" prop="chanpin_name" label-width="180">
							<u-input placeholder="扫一扫" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
					</view>
					<view class="bg-white padding shadow radius margin-bottom">
						<view class="flex">
							<u-icon  class="cuIcon-titles" size="50" color="#0081ff"></u-icon> 
							<view class="text-xxl text-black">工装信息</view>
						</view>
						<u-form-item label="工装编号" prop="chanpin_name" label-width="180">
							02Dc232000C2
						</u-form-item>
						<u-form-item label="工装名称" prop="chanpin_name" label-width="180">
							冲孔落料模
						</u-form-item>
						<u-form-item label="工装寿命" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
						<u-form-item label="使用寿命" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
						<u-form-item label="保养次数" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
					</view>
					<view class="bg-white padding shadow radius margin-bottom">
						<view class="flex">
							<u-icon class="cuIcon-titles" size="50" color="#0081ff"></u-icon> 
							<view class="text-xxl text-black">工装其他信息</view>
						</view>
						<u-form-item label="工装编号" prop="chanpin_name" label-width="180">
							02Dc232000C2
						</u-form-item>
						<u-form-item label="工装名称" prop="chanpin_name" label-width="180">
							冲孔落料模
						</u-form-item>
						<u-form-item label="工装寿命" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
						<u-form-item label="使用寿命" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
						<u-form-item label="保养次数" prop="chanpin_name" label-width="180">
							<u-input placeholder="请输入" v-model="model.chanpin_name" type="text" maxlength="64"></u-input>
						</u-form-item>
					</view>
				
				</scroll-view>
			</u-form>
			
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				model: {
					chanpin_name:''
				},
				focus:false,
				barCode: "",
				rules: {
					chanpin_name: [
						{
							required: true,
							message: '请扫描现品票',
							trigger: ['change','blur'],
						}
					]
				},
				scrollViewHeight:0,
				formFooterHeight: 0,
				headerHeight: 0
			}
		},
		onReady() {
			this.$refs.uForm.setRules(this.rules);
		},
		mounted() {
		  this.calculateScrollViewHeight();
		},
		methods:{

			async calculateScrollViewHeight() {
			  	await this.$nextTick(); // 确保DOM更新完成
			  	const screenHeight = uni.getSystemInfoSync().windowHeight;
			  	// 计算scroll-view高度
			  	this.scrollViewHeight = screenHeight;
			},
		}
	}
</script>

<style>
	.cuIcon-titles{
		color:#0081ff;
		font-size: 50rpx;
	}
</style>